package test.lyj;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;


import test.lyj.model.ListAdapter;
import test.lyj.tool.Tool;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class ListBaseActivity extends Activity {
	private ListView listView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		Log.d("lyjtest", "startOnCreate");
		setContentView(R.layout.list_base_window);
		Log.d("lyjtest", "startWindowSwithe");
		Button logonButton = (Button) findViewById(R.id.btn_logon);
		listView = (ListView) findViewById(R.id.lv_inlist);
		ArrayList temp=Tool.getStaticMap(this,0,20);
		ListAdapter listAdapter=new ListAdapter(ListBaseActivity.this, temp, R.layout.list_base_window_item, new String[]{"icon","name","address"}, new int[]{R.id.item_image,R.id.item_name,R.id.item_address});
		listView.setAdapter(listAdapter);
		listView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				Tool.showMsgDialog(ListBaseActivity.this, arg3+"有戏？"+arg2);
			}
		});
	}

//	OnClickListener logonClicker = new OnClickListener() {
//
//		@Override
//		public void onClick(View v) {
//			Intent intent = new Intent();
//			intent.setClass(TestLyjLunch.this, ListBaseActivity.class);
//			startActivity(intent);
//			// TestLyjLunch.this.finish();
//
//		}
//	};

}
